﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Faculty.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<fivescomplement.Models.GetCoursesFaculty_Result  >>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Courses Taught</h2>
    
        <% using (Html.BeginForm()) { %>

                <fieldset>
                 <% if (Model.Count() > 0)
                    { %>
                    <table id="table">
                        <tr>
                            <th>Course</th>
                            <th>Instructor</th>
                            <th>Start Date</th>
                        </tr>
                    <% int test;%>
                    <% test = 0;%>
                    <% foreach (var item in Model)
                       { %>
                        <tr>
                            <td>
                            <%: Html.Hidden("CourseName" + test.ToString(), item.CourseName)%>
                            <%: Html.Hidden("InstitutionID" + test.ToString(), item.InstitutionID)%>
                            <%: Html.ActionLink(item.CourseName, "Course", new { id = item.CourseID })%> 
                            </td>
                            <td>
                            <%: item.InstructorsFirstName%>
                            <%: item.InstructorsLastName%>
                            <% test += 1;%>
                            </td>
                            <td>
                             <%: item.StartDate%>
                            </td>
                        </tr>
    
                    <% } %>

                    </table>
                
                <% } %>
                <% else
                    { %>
                <% } %>
                </fieldset>
            </div>
        <% } %>
</asp:Content>
